<html>
<head><meta charset="utf-8"><title>terminology: const param types · project-const-generics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/index.html">project-const-generics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html">terminology: const param types</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235348659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235348659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235348659">(Apr 20 2021 at 14:03)</a>:</h4>
<p>when talking about <code>ty</code> in <code>const NAME: ty</code>, how should we call that? (mostly for diagnostics and blog posts and stuff)</p>
<p>I think the most concise name would be "const parameter type".<br>
This might however be confusing because it can also be interpreted as: a type which is a const parameter (which doesn't really make sense ^^)</p>
<p>there's the slightly longer, but unambiguous "type of a const parameter" which seems a bit too wordy for my liking</p>



<a name="235356253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235356253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jknodt <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235356253">(Apr 20 2021 at 14:51)</a>:</h4>
<p>const parameter's type?</p>



<a name="235356740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235356740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235356740">(Apr 20 2021 at 14:54)</a>:</h4>
<p>example error message?</p>



<a name="235392968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235392968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235392968">(Apr 20 2021 at 18:35)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(const_generics)]</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">NAME</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="kt">str</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="p">());</span><span class="w"></span>
</code></pre></div>



<a name="235392986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235392986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235392986">(Apr 20 2021 at 18:35)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0771]: use of non-static lifetime `&#39;a` in const generic
 --&gt; src/lib.rs:3:29
  |
3 | struct Foo&lt;&#39;a, const NAME: &amp;&#39;a str&gt;(&amp;&#39;a ());
  |                             ^^
  |
  = note: for more information, see issue #74052 &lt;https://github.com/rust-lang/rust/issues/74052&gt;
</code></pre></div>



<a name="235393087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235393087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235393087">(Apr 20 2021 at 18:36)</a>:</h4>
<p>i kind of like "use of non-static lifetime <code>'a</code> in const parameter's type"</p>



<a name="235393123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235393123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235393123">(Apr 20 2021 at 18:36)</a>:</h4>
<p>fairly short and doesn't have the issue of "const parameter type"</p>



<a name="235418328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/235418328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#235418328">(Apr 20 2021 at 21:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types/near/235393087">said</a>:</p>
<blockquote>
<p>i kind of like "use of non-static lifetime <code>'a</code> in const parameter's type"</p>
</blockquote>
<p>I'd be happy with this, though I know some style guides for UI suggest not using apostrophes. I don't know whether that's for readability or formality concerns, though.</p>



<a name="237396463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/terminology%3A%20const%20param%20types/near/237396463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/terminology.3A.20const.20param.20types.html#237396463">(May 04 2021 at 20:57)</a>:</h4>
<blockquote>
<p>though I know some style guides for UI suggest not using apostrophes</p>
</blockquote>
<p>hmm, i guess i am going with "const parameter type" in that case <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> should take some time to look at UI style guides in the near future though</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>